package com.my.study.common.security.gitee;

import com.my.study.dto.JwtUserDto;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.HttpMessageNotWritableException;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author yidujun
 * @date 2022/8/9 19:18
 */
public class JwtUserHttpMessageConverter extends AbstractHttpMessageConverter<JwtUserDto> {

    protected JwtUserHttpMessageConverter() {
        super(MediaType.APPLICATION_JSON, MediaType.ALL);
    }

    @Override
    protected boolean supports(Class<?> clazz) {
        return JwtUserDto.class == clazz;
    }

    @Override
    protected JwtUserDto readInternal(Class<? extends JwtUserDto> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException {
        InputStream body = inputMessage.getBody();
        

        return null;
    }

    @Override
    protected void writeInternal(JwtUserDto jwtUserDto, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
        
    }
}
